include_directories(${PROJECT_SOURCE_DIR}/include)

find_library(LIBUSBVAL usb-1.0)
message(${LIBUSBVAL})

if(LIBUSBVAL)
    message(STATUS "libusb library has been found")
else(LIBUSBVAL)
    message(FATAL_ERROR "can not find libusb or version < 1.0")
endif(LIBUSBVAL)

add_library(attachRev SHARED attachRev.cpp) 
target_link_libraries(attachRev usb-1.0)
set_target_properties(attachRev PROPERTIES 
                                LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib
                                VERSION 1.0 SOVERSION 1)

add_executable(countRev main.cpp)
target_link_libraries(countRev attachRev)
set_target_properties(countRev PROPERTIES 
                                RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin )
